<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Libraria Anonimus</title>
<link href='http://fonts.googleapis.com/css?family=Arvo' rel='stylesheet' type='text/css'>
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<?php include_stylesheets() ?>
</head>
<body>
	<div id="menu-wrapper">
		<div id="menu">
			<ul>
				<li class="current_page_item"><a href="http://localhost:8080/frontend_dev.php/carte/homepage">Homepage</a></li>
				<li><a href="http://localhost:8080/frontend_dev.php/carte">Browse</a></li>
				<li><a href="http://localhost:8080/frontend_dev.php/general/Search">Search</a></li>
				<li><a href="http://localhost:8080/frontend_dev.php/user/login">Autentificate</a></li>
				<li><a href="http://localhost:8080/frontend_dev.php/general/Contact">Contact</a></li>
			</ul>
		</div>
		<!-- end #menu -->
	</div>
<?php 
	if ($sf_user->isUserLogged()):
?>

<DIV ALIGN="right">
<table>
<tr >
<td width="60">
 <a href=<?php echo url_for('user/logout');?>>Log out</a> 
</td>
<td width="60">
	<a href=<?php echo url_for('user/edit?id_user='.$sf_user->getCurrentUser()->getIdUser().'&user_name='.$sf_user->getCurrentUser()->getUserName()); ?>> User acount </a>
</td>
<td width="60">
	<a href=<?php echo url_for('user/cos/cos?id_user='.$sf_user->getCurrentUser()->getIdUser().'&user_name='.$sf_user->getCurrentUser()->getUserName()); ?>><img src="/images/cos.png" width="40" height='40'></img></a>
</td>
</tr>
</table>
</DIV>	
			
<?php 
	endif;
?>
<div id="wrapper">
	<div id="header-wrapper">
		<div id="header">
			<div id="logo">
				<img src="/images/logo.jpg"/>
			</div>
		</div>
	</div>
	<!-- end #header -->
	
	<div id="page">
		<div id="page-bgtop">
			<div id="page-bgbtm">
				<div id="content">
					<?php echo $sf_content ?>
				</div>
				<!-- end #content -->
				<div id="sidebar">
					
					<table>
  <tbody>
  	<tr>
  	<td style="color:navy;">
  	 Cele mai cumparate carti: 
  	 </td>
  	 </tr>
    <?php 
    	$q = Doctrine_Query::create()->from('Carte c')->orderBy('c.data_adaugarii')->limit(5); 
   		$cartes = $q->execute();
    	foreach ($cartes as $carte):  
    ?>
    <tr>
      <table>
      <tr>
      	<td><img src="<?php echo $carte->getPoza() ?>" width="70" height="100"></td>
      	<td>
      		<table>
      		<tr>
      			<td> 
      			<a href = "<?php echo url_for('carte/show?id_carte='.$carte->getIdCarte().'&titlu='.$carte->getTitlu()); ?>"><?php echo $carte->getTitlu(); ?></a></td>
      		</tr>
      		<tr>
      			<td><b><?php echo $carte->getPret(); echo " lei" ?></b></td>
      		</tr>
      		<tr>
      			<td><?php if($carte->getStoc()>0) echo "In stoc"; else echo "Stoc epuizat" ?></td>
      		</tr>
      		</table>
      	</td>
      </tr>
      </table>
      </tr>
    <?php endforeach; ?>
  </tbody>
</table>
					
					
					
				</div>
				<!-- end #sidebar -->
				<div style="clear: both;">&nbsp;</div>
			</div>
		</div>
	</div>
	<!-- end #page -->
</div>

<div id="footer">
	<p>Copyright (c) 2012 Claudia Iosipescu and Alexandra Duta. All rights reserved. Design by Claudia Iosipescu and Alexandra Duta.</a></p>
</div>
<!-- end #footer -->

</body>
</html>